﻿// -----------------------------------------------------------------------
// <copyright file="BuilderOfCircles.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex3.Logic
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using FacebookWrapper;
    using FacebookWrapper.ObjectModel;

    /// <summary>
    /// Concrete builder
    /// </summary>
    public class BuilderOfCircles : Builder
    {
        private string NameCircle { get; set; }

        private List<SerializableUserInCircuit> SerializableFriends { get; set; }

        public override Circle GetNewCircle()
        {
            Circle newCircle = new Circle(this.NameCircle, this.SerializableFriends);
            return newCircle;
        }

        public override void BuildCircleName(string i_NameCircle)
        {
            this.NameCircle = i_NameCircle;
        }

        public override void BuildFriends(List<User> i_Friends)
        {
            this.SerializableFriends = new List<SerializableUserInCircuit>();
            foreach (User friend in i_Friends)
            {
                SerializableUserInCircuit newFriend = new SerializableUserInCircuit(friend);
                this.SerializableFriends.Add(newFriend);
            }
        }
    }
}
